package com.csw.xuxianParent.xuxianBase.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csw.xuxianParent.xuxianBase.dao.LabelResposity;
import com.csw.xuxianParent.xuxianBase.dao.Label;
import com.csw.xuxianParent.xuxianCommon2.utils.IdWorker;

/**
 * @author 1
 */
@Service
public class LabelServiceImpl implements LabelService {
	@Autowired
	private LabelResposity labelResposity;
	@Autowired
	private IdWorker idWorker;

	@Override
	public Label addLabel(Label label) {
		label.setId(idWorker.nextId() + "");
		return labelResposity.save(label);
	}

	@Override
	public Label getLabelById(String id) {
		return labelResposity.findById(id).get();
	}
}
